use std::collections::VecDeque;

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum InputMap {
    MoveLeft,
    MoveRight,
    MoveDown,
    Rotate,
    Enter,
    Exit,
}

pub struct Input<E> {
    events: VecDeque<E>
}

impl<E> Input<E> {
    pub  fn new() -> Self {
        Self {
            events: VecDeque::new(),
        }
    }

    pub fn push_event(&mut self, event: E) {
        self.events.push_back(event);
    }

    /// Usage:
    /// ```
    /// while let Some(event) = input.poll() {
    ///     
    /// }
    /// ```
    pub fn poll(&mut self) -> Option<E> {
        self.events.pop_front()
    }
}
